import axiosInstance from './index.js'
// 获取展会列表
export const _getExhibitionList = () => axiosInstance.get('/api/oly/exhibition');
// 添加展会
export const _addExhibition = (params) => axiosInstance.post('/api/oly/exhibition',params)
// 更新展会
export const _updateExhibition = (params) => axiosInstance.put('/api/oly/exhibition',params)
// 登录
export const _login = (params) => axiosInstance.post('/api/oly/login',params)
// 模板列表
export const _getTemplateList = () => axiosInstance.get('/api/oly/template')
// 根据模板id查询字段信息
export const _getTemplateById = (id) => axiosInstance.get(`/api/oly/field/${id}`)
//获取证件类型列表
export const _getCardTypeList = (current = 1,size = 15) => axiosInstance.get('/api/oly/cert',{ params:{current, size }});
// 添加证件类型
export const _addCardType = (params) => axiosInstance.post('/api/oly/cert',params);
// 删除证件类型
export const _delCardType = (id) => axiosInstance.delete(`/api/oly/cert/${id}`);
//更新证件类型
export const _updateCardType = (params) => axiosInstance.put('/api/oly/cert',params);
// 获取人车类型列表
export const _getCardAllType = (childId = 0) => axiosInstance.get(`/api/oly/type/${childId}`);
//添加模板
export const _addTemplate = (params) => axiosInstance.post('/api/oly/template',params);
// 删除表单列表
export const _delForm = (id) => axiosInstance.delete(`/api/oly/template/${id}`);
// 更新模板
export const _updateForm = (params) => axiosInstance.put('/api/oly/template',params);
// 根据id查询模板详情
export const _getFormInfoById = (id) => axiosInstance.get(`/api/oly/template/${id}`);
// 获取操作日志列表
export const _logList = (current) => axiosInstance.get('/api/oly/log',{ params:{ current, size:15} });
// 获取字段配置列表
export const _getFieldList = (params) => axiosInstance.get('/api/oly/fields',{ params });
// 人员注册
export const _addPerson = (params) => axiosInstance.post('/api/oly/staff',params);
// 人员列表
export const _personList = (params) => axiosInstance.get('/api/oly/staff/page',{ params });
// 获取人员详情
export const _getPersonId = (id) => axiosInstance.get(`/api/oly/staff/${id}`);
// 更新人员信息
export const _updatePerson = (params) => axiosInstance.post('/api/oly/staff/update',params);
// 获取菜单列表
export const _getMenuList = (id) => axiosInstance.get(`/api/sys/userrole/${id}`);
// 获取审核列表
// export const _getCheckList = (params) => axiosInstance.get('/api/oly/staff/pages',{ params })
export const _getCheckListByPerson = (params) => axiosInstance.get('/api/oly/staff/rzPages',{ params });
// 车证
export const _getCheckListByCar = (params) => axiosInstance.get('/api/oly/staff/czPages',{ params })
// 获取字段集合列表
export const _getFieldInfoList = () => axiosInstance.get('/api/oly/field/list')
// 获取用户列表
export const _getUserList = (params) => axiosInstance.get('/api/oly/user',{ params })
// 获取用户详情
export const _getUserDetail = (id) => axiosInstance.get(`/api/oly/user/${id}`);
// 添加用户信息
export const _addUserInfo = (params) => axiosInstance.post('/api/oly/user',params);
// 更新用户信息
export const _updateUserInfo = (params) => axiosInstance.put('/api/oly/user',params);
// 人员审核
export const _personCheck = (params) => axiosInstance.post('/api/oly/staff/update',params);
//人员批量审核
export const _personCheckAll = (params) => axiosInstance.put('/api/oly/staff/batchUpdate',params);
// 获取角色审核权限
export const _getRoleAudit = (id) => axiosInstance.get(`/api/sys/roleAudit/role/${id}`)
// 删除用户
export const _delUser = (id) => axiosInstance.delete(`/api/oly/user/${id}`)
//获取所有权限
export const _getAllRole = (id) => axiosInstance.get('/api/sys/role/listRole',{ params:{id}})
// 获取额度列表
export const _getQuotaList = (current) => axiosInstance.get('/api/oly/usercert', { params:{ current ,size: 15 }})
// 更新证件配置
export const _updateQuota = (userId,params) => axiosInstance.post(`/api/oly/user/updateUserCertArea/${userId}`,params);
// 根据用户id查询用户下证件的区域
export const _getAreaByUserId = (params) => axiosInstance.post('/api/oly/user/findCertArea',params)
// add
//获取证件配置详情
export const _getCardTypeSet = (userId) => axiosInstance.get(`/api/oly/user/find/${userId}`);
// 更新用户配置
export const _updateCardTypeSet = (params) => axiosInstance.put('/api/oly/user',params)
// 获取角色列表
export const _getRoleList = () => axiosInstance.get('/api/sys/role/list');
// 获取角色列表
export const _getUserRoleList = () => axiosInstance.get('/api/sys/userrole');
// 根据用户id获取用户菜单权限按钮
export const _getUserRoleListBtn = (id) => axiosInstance.get(`/api/sys/userrole/${id}`);
// 更新角色权限
export const _updateRole = (params) => axiosInstance.put('/api/sys/userrole/menu',params);
// 根据用户id查询额度
export const _getUserQuota = (useId) => axiosInstance.get(`/api/oly/usercert/${useId}`);
// 身份证号查重
export const _idCodeSearch = (idCode,type,passportNationality) => axiosInstance.get(`/api/oly/staff/check/${idCode}/${type}/${passportNationality}`);
// 添加字段
export const _addFields = (params) => axiosInstance.post('/api/oly/fields',params);
// 添加下拉框
export const _addBox = (params) => axiosInstance.post('/api/oly/box',params);
// 更新字段
export const _updateField = (params) => axiosInstance.put('/api/oly/fields',params);
// 获取选项列表
export const _getOptionList = (id) => axiosInstance.get(`/api/oly/box/list/${id}`);
// 根据别名查询列表
export const _getOptionListByName = (type) => axiosInstance.get(`/api/oly/box/field/${type}`);
// 删除选项列表
export const _delOptionList = (id) => axiosInstance.delete(`/api/oly/box/${id}`)
// 数据导出
export const _exitData = (params) => axiosInstance.get('/api/oly/staff/exit',params);
// 删除字段
export const _delField = (id) => axiosInstance.delete(`/api/oly/fields/${id}`);
// 更新下拉框
export const _updateBox = (params) => axiosInstance.put('/api/oly/box',params);
// 背审导出
export const _exitTemplate = (params) => axiosInstance.get('/api/oly/exit/exit',{params});
// 背审状态通知
export const _exitSend = (params) => axiosInstance.post('/api/oly/staff/bsState',params);
// 人员导入
export const _importPerson = (params,userId,exhibitionId,templateId,type,state) => axiosInstance.post(`/api/oly/exit/import/${userId}/${exhibitionId}/${templateId}/${type}/${state}`,params,{
    'Content-Type': 'multipart/form-data'
})
// 人员导入轮询
export const _importFindState = (uuId) => axiosInstance.get(`/api/oly/exit/findState/${uuId}`);
// 上传证件照片 人证
export const _importCardImg = (params,userId,exhibitionId,templateId,uuId,type) => axiosInstance.post(`/api/oly/exit/implImg/${userId}/${exhibitionId}/${templateId}/${uuId}/${type}`,params,{
    'Content-Type': 'multipart/form-data'
})
// 上传证件照 车证
export const _importCarImg = (params,userId,exhibitionId,templateId,uuId,type) => axiosInstance.post(`/api/oly/exit/implCar/${userId}/${exhibitionId}/${templateId}/${uuId}/car`,params,{
    'Content-Type': 'multipart/form-data'
})
// 获取错误列表
export const _importErrorList = (params) => axiosInstance.get('/api/oly/msg',{ params });
// 获取uuid列表
export const _getUUidList = () => axiosInstance.get('/api/oly/staff/findUUId');
// 获取停车区域列表
export const _getAreaList = (current = 1,size=15) => axiosInstance.get('/api/oly/area',{ params:{ current ,size }});
// 添加停车区域
export const _addArea = (params) => axiosInstance.post('/api/oly/area',params);
// 更新停车区域
export const _updateArea = (params) => axiosInstance.put('/api/oly/area',params);
// 删除停车区域
export const _delArea = (id) => axiosInstance.delete(`/api/oly/area/${id}`);
// 车辆数据导入
export const _carImportData = (params,userId,exhibitionId,templateId) => axiosInstance.post(`/api/oly/exit/importCar/${userId}/${exhibitionId}/${templateId}`,params,{
    'Content-Type': 'multipart/form-data'
})
// 车牌号重复检测
export const _carNumberCheck = (carNum) => axiosInstance.get(`/api/oly/staff/check/${carNum}`);
// 查询待审数量
export const _getUnapproved = (userId,role,flag) => axiosInstance.get(`/api/oly/staff/queryUnapproved/${userId}/${role}/${flag}`);
// 车辆流水列表
export const _getCertFlowList = (params) => axiosInstance.get('/api/oly/certFlow/page',{ params });
// 背审导出
export const _exportStaff = (type) => axiosInstance.get(`/api/oly/exit/exportStaff/${type}`,{responseType: "blob"});
// 背审导入
export const _importStaff = (params) => axiosInstance.post(`/api/oly/exit/importStaff`,params,{
    'Content-Type': 'multipart/form-data'
})
// 获取登录验证码图片
// export const _verifyCode = () => axiosInstance.get('/api/oly/login/verify');
export const _verifyCode = () => axiosInstance.get('/api/oly/code/verifyCode');
// 证件注销 0 人 1车
export const _cardCancel = (type,params) => axiosInstance.put(`/api/oly/staff/logout/${type}`,params);
// 批量提交审核
export const _checkAllApply = (params) => axiosInstance.post('/api/oly/staff/draftsBachUpdate',params);
// 批量删除草稿箱数据
export const _delAll = (params) => axiosInstance.post('/api/oly/staff/deleteStaff',params);
// 批量删除拒绝数据
export const _delAllRefuse = (params) => axiosInstance.post('/api/oly/staff/deleteOneRefuseStaff',params)
// 重新提交审核
export const _resetState = (params) => axiosInstance.post('/api/oly/staff/resetState',params);
// 重置更新密码
export const _resetPassword = (params) => axiosInstance.post('/api/oly/user/updateUserInfo',params);
// 全量数据查询 人证
export const _searchAllList = (params) => axiosInstance.get('/api/oly/staff/queryPages',{params})
// 发证
export const _sendCardUpdate = (params) => axiosInstance.put('/api/oly/staff/sendCert',params);


export const _test = (userid) => axiosInstance.get('/api/oly/login/find/'+userid)